3.5.69 \(\int (a+b \sec (c+d x))^3 \, dx\) [469]

Optimal. Leaf size=73 \[ a^3 x+\frac {b \left (6 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {5 a b^2 \tan (c+d x)}{2 d}+\frac {b^2 (a+b \sec (c+d x)) \tan (c+d x)}{2 d} \]

[Out]

a^3*x+1/2*b*(6*a^2+b^2)*arctanh(sin(d*x+c))/d+5/2*a*b^2*tan(d*x+c)/d+1/2*b^2*(a+b*sec(d*x+c))*tan(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 73, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3867, 3855, 3852, 8} \begin {gather*} a^3 x+\frac {b \left (6 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {5 a b^2 \tan (c+d x)}{2 d}+\frac {b^2 \tan (c+d x) (a+b \sec (c+d x))}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*Sec[c + d*x])^3,x]

[Out]

a^3*x + (b*(6*a^2 + b^2)*ArcTanh[Sin[c + d*x]])/(2*d) + (5*a*b^2*Tan[c + d*x])/(2*d) + (b^2*(a + b*Sec[c + d*x
])*Tan[c + d*x])/(2*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3867

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Simp[(-b^2)*Cot[c + d*x]*((a + b*Csc[c + d*x])^(
n - 2)/(d*(n - 1))), x] + Dist[1/(n - 1), Int[(a + b*Csc[c + d*x])^(n - 3)*Simp[a^3*(n - 1) + (b*(b^2*(n - 2)
+ 3*a^2*(n - 1)))*Csc[c + d*x] + (a*b^2*(3*n - 4))*Csc[c + d*x]^2, x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ
[a^2 - b^2, 0] && GtQ[n, 2] && IntegerQ[2*n]

Rubi steps

\begin {align*} \int (a+b \sec (c+d x))^3 \, dx &=\frac {b^2 (a+b \sec (c+d x)) \tan (c+d x)}{2 d}+\frac {1}{2} \int \left (2 a^3+b \left (6 a^2+b^2\right ) \sec (c+d x)+5 a b^2 \sec ^2(c+d x)\right ) \, dx\\ &=a^3 x+\frac {b^2 (a+b \sec (c+d x)) \tan (c+d x)}{2 d}+\frac {1}{2} \left (5 a b^2\right ) \int \sec ^2(c+d x) \, dx+\frac {1}{2} \left (b \left (6 a^2+b^2\right )\right ) \int \sec (c+d x) \, dx\\ &=a^3 x+\frac {b \left (6 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b^2 (a+b \sec (c+d x)) \tan (c+d x)}{2 d}-\frac {\left (5 a b^2\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{2 d}\\ &=a^3 x+\frac {b \left (6 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {5 a b^2 \tan (c+d x)}{2 d}+\frac {b^2 (a+b \sec (c+d x)) \tan (c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.17, size = 55, normalized size = 0.75 \begin {gather*} \frac {2 a^3 d x+b \left (6 a^2+b^2\right ) \tanh ^{-1}(\sin (c+d x))+b^2 (6 a+b \sec (c+d x)) \tan (c+d x)}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sec[c + d*x])^3,x]

[Out]

(2*a^3*d*x + b*(6*a^2 + b^2)*ArcTanh[Sin[c + d*x]] + b^2*(6*a + b*Sec[c + d*x])*Tan[c + d*x])/(2*d)

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 82, normalized size = 1.12

method result size
derivativedivides \(\frac {a^{3} \left (d x +c \right )+3 b \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 b^{2} a \tan \left (d x +c \right )+b^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) \(82\)
default \(\frac {a^{3} \left (d x +c \right )+3 b \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 b^{2} a \tan \left (d x +c \right )+b^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) \(82\)
risch \(a^{3} x -\frac {i b^{2} \left (b \,{\mathrm e}^{3 i \left (d x +c \right )}-6 a \,{\mathrm e}^{2 i \left (d x +c \right )}-b \,{\mathrm e}^{i \left (d x +c \right )}-6 a \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2}}{d}-\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}+\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{2}}{d}+\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}\) \(154\)
norman \(\frac {a^{3} x +a^{3} x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {b^{2} \left (b +6 a \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-2 a^{3} x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {b^{2} \left (6 a -b \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {b \left (6 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {b \left (6 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) \(158\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sec(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

1/d*(a^3*(d*x+c)+3*b*a^2*ln(sec(d*x+c)+tan(d*x+c))+3*b^2*a*tan(d*x+c)+b^3*(1/2*sec(d*x+c)*tan(d*x+c)+1/2*ln(se
c(d*x+c)+tan(d*x+c))))

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 93, normalized size = 1.27 \begin {gather*} a^{3} x - \frac {b^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{4 \, d} + \frac {3 \, a^{2} b \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right )}{d} + \frac {3 \, a b^{2} \tan \left (d x + c\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(d*x+c))^3,x, algorithm="maxima")

[Out]

a^3*x - 1/4*b^3*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1))/d + 3*a^
2*b*log(sec(d*x + c) + tan(d*x + c))/d + 3*a*b^2*tan(d*x + c)/d

________________________________________________________________________________________

Fricas [A]
time = 2.75, size = 112, normalized size = 1.53 \begin {gather*} \frac {4 \, a^{3} d x \cos \left (d x + c\right )^{2} + {\left (6 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (6 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (6 \, a b^{2} \cos \left (d x + c\right ) + b^{3}\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(d*x+c))^3,x, algorithm="fricas")

[Out]

1/4*(4*a^3*d*x*cos(d*x + c)^2 + (6*a^2*b + b^3)*cos(d*x + c)^2*log(sin(d*x + c) + 1) - (6*a^2*b + b^3)*cos(d*x
 + c)^2*log(-sin(d*x + c) + 1) + 2*(6*a*b^2*cos(d*x + c) + b^3)*sin(d*x + c))/(d*cos(d*x + c)^2)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right )^{3}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(d*x+c))**3,x)

[Out]

Integral((a + b*sec(c + d*x))**3, x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 145 vs. \(2 (67) = 134\).
time = 0.44, size = 145, normalized size = 1.99 \begin {gather*} \frac {2 \, {\left (d x + c\right )} a^{3} + {\left (6 \, a^{2} b + b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (6 \, a^{2} b + b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(d*x+c))^3,x, algorithm="giac")

[Out]

1/2*(2*(d*x + c)*a^3 + (6*a^2*b + b^3)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - (6*a^2*b + b^3)*log(abs(tan(1/2*d*
x + 1/2*c) - 1)) - 2*(6*a*b^2*tan(1/2*d*x + 1/2*c)^3 - b^3*tan(1/2*d*x + 1/2*c)^3 - 6*a*b^2*tan(1/2*d*x + 1/2*
c) - b^3*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 - 1)^2)/d

________________________________________________________________________________________

Mupad [B]
time = 0.95, size = 136, normalized size = 1.86 \begin {gather*} \frac {2\,a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {b^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {b^3\,\sin \left (c+d\,x\right )}{2\,d\,{\cos \left (c+d\,x\right )}^2}+\frac {6\,a^2\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {3\,a\,b^2\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b/cos(c + d*x))^3,x)

[Out]

(2*a^3*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (b^3*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d +
 (b^3*sin(c + d*x))/(2*d*cos(c + d*x)^2) + (6*a^2*b*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (3*a*b^2
*sin(c + d*x))/(d*cos(c + d*x))

________________________________________________________________________________________